---------------------------------------
-- Build A Global Table Of Ore Types --
---------------------------------------

AM_OreTable = {}
AM_OreVolTable = {}

-- Insert a new Ore tpye into the table
function AM_AddOre(ore, volume)
	if 	table.HasValue( AM_OreTable, ore ) then  --We don't want duplicates :)
	    return false
	else
		table.insert(AM_OreTable, ore)
		table.insert(AM_OreVolTable, volume)
	end
end

-- Get some info from the table
function AM_GetOre(num)
	if not num then
		return AM_OreTable  --Return the whole table
	else
	    return AM_OreTable[num]  --Return the desired table value
	end
end

function testmessage()

	Msg("OreTable "..tostring(table.ToString(AM_OreTable)).."\n")
	Msg("OreVolTable "..tostring(table.ToString(AM_OreVolTable)).."\n")

end
--timer.Create( "duhtimer", 30, 0, testmessage )


---------------------------------------
-- What Ice Refines To --
-------------------------

function AM_GetRefined(ore, efficiency)
	if not efficiency then efficiency = 0.5 end
	
	local minerals = {}
	
	if ore == "Blue Ice" then
		minerals.water	 = math.floor(5000 * efficiency)
		minerals.oxygen 	= math.floor(300 * efficiency)
		minerals.hydrogen 	= math.floor(100 * efficiency)
		minerals.nitrogen 	= math.floor(100 * efficiency)
	elseif ore == "Clear Ice" then 
		minerals.water	 = math.floor(5000 * efficiency)
		minerals.oxygen 	= math.floor(300 * efficiency)
		minerals.hydrogen 	= math.floor(100 * efficiency)
		minerals.nitrogen 	= math.floor(100 * efficiency)
	elseif ore == "Glacial Mass" then
		minerals.water	 = math.floor(10000 * efficiency)
		minerals.oxygen 	= math.floor(300 * efficiency)
		minerals.hydrogen 	= math.floor(100 * efficiency)
		minerals.nitrogen 	= math.floor(100 * efficiency)
	elseif ore == "White Glaze" then
		minerals.water	 = math.floor(5000 * efficiency)
		minerals.oxygen 	= math.floor(300 * efficiency)
		minerals.hydrogen 	= math.floor(100 * efficiency)
		minerals.nitrogen 	= math.floor(100 * efficiency)
	elseif ore == "Dark Glitter" then
		minerals.water	 = math.floor(5000 * efficiency)
		minerals.oxygen 	= math.floor(300 * efficiency)
		minerals.hydrogen 	= math.floor(100 * efficiency)
		minerals.nitrogen 	= math.floor(100 * efficiency)
	elseif ore == "Glare Crust" then
		minerals.water	 = math.floor(5000 * efficiency)
		minerals.oxygen 	= math.floor(300 * efficiency)
		minerals.hydrogen 	= math.floor(100 * efficiency)
		minerals.nitrogen 	= math.floor(100 * efficiency)
	elseif ore == "Gelidus" then
		minerals.water	 = math.floor(2000 * efficiency)
		minerals.oxygen 	= math.floor(300 * efficiency)
		minerals.hydrogen 	= math.floor(0 * efficiency)
		minerals.nitrogen 	= math.floor(500 * efficiency)
	elseif ore == "Krystallos" then
		minerals.water	 = math.floor(2000 * efficiency)
		minerals.oxygen 	= math.floor(500 * efficiency)
		minerals.hydrogen 	= math.floor(500 * efficiency)
		minerals.nitrogen 	= math.floor(0 * efficiency)
	end
	
	return minerals
	
end



